<?php
namespace app\beautiful\model;
use app\common\model\CommonModel;
use app\beautiful\model\member\MemberModel;

class PartnerModel extends CommonModel{
    protected  $name = 'beautiful_partner';
    protected  $pk   = 'partner_id';


    public function getIsExpireAttr($value,$data)
    {
        return $data['expire_time'] ? ($data['expire_time'] >= date("Y-m-d") ? 0 : 1 ) : 1;
    }



    public function getRoleMeansAttr($value,$data)
    {
        $role_means=[
            1=>'股金合伙人',
            2=>'员工合伙人',
            3=>'会员合伙人',
            4=>'自定义合伙人'
        ];
        return $role_means[$data['role_id']] ?? '-';
    }
}
